include ./stdmk

PROGRAMS = dbloader liboraldr.so
# libdb2ldr.so dlopen
INSTALL  = .

all: $(PROGRAMS)

OBJS = main.o dbloader.o inifile.o exception.o common.o zipfile.o file.o strsplit.o

libdb2ldr.so: 
	$(CPPLINK) $(INCLS) -c -I$(DB2PATH)/include db2loader.cpp
	$(CPP) $(SHROBJ) -o libdb2ldr.so db2loader.o dbloader.o inifile.o exception.o -ldb2 -L$(DB2PATH)/lib
	cp libdb2ldr.so $(INSTALL)/lib/

liboraldr.so:
	$(CPPLINK) $(INCLS) -c -I$(ORACLE_HOME)/rdbms/demo -I$(ORACLE_HOME)/rdbms/public/ -fPIC src/oraloader.cpp
	$(CPP) $(SHROBJ) -o liboraldr.so oraloader.o dbloader.o inifile.o exception.o -lclntsh -L$(ORACLE_HOME)/lib -L$(ORACLE_HOME)/rdbms/lib
	cp liboraldr.so $(INSTALL)/lib/

dbloader:$(OBJS) 
	$(CPP) $(DYNAMIC) $(OBJS) $(LIBS) -o $@

dlopen:dlopen.o
	$(CPP) $(DYNAMIC) dlopen.o $(LIBS) -o dlopen
